<template>
    <div>
        <h2>parent - 父组件</h2>
        <p>msg -- {{msg}}</p>
        <p>num --- {{num}}</p>
        <p>
            <input type="text" v-model="msg">
        </p>
        <button @click="changeNum">点击修改num</button>
        <hr>
        <childone :msg="msg" :num="num" ref="one"></childone>
        <hr>

        <childtwo></childtwo>
    </div>
</template>

<script>
import childone from './ChildOne.vue'
import childtwo from './ChildTwo.vue'

export default {
    data(){
        return{
            msg:"2116 -- 学好vue",
            num:1000
        }
    },
    methods:{
        changeNum(){
            this.num++
        }
    },
    components:{
        childone,
        childtwo
    }    
}
</script>